<?php
/**
 * Author: Administrator
 * Date: 2022/7/18 1:58
 */

namespace DesignPatterns\Structural\Composite;


class Text extends FormElement
{
    protected $text;
    public function __construct($text = '')
    {
        $this->text = $text;
    }

    public function render($indent = 0)
    {
        return str_pad("  ", $indent) . $this->text;
    }
}